package com.atguigu.exam.service;


import com.atguigu.exam.entity.Question;
import com.atguigu.exam.vo.AiGenerateRequestVo;
import com.atguigu.exam.vo.GradingResult;
import com.atguigu.exam.vo.QuestionImportVo;

import java.util.List;

/**
 * Kimi AI服务接口
 * 用于调用Kimi API生成题目
 */
public interface KimiAiService {
    String buildPrompt(AiGenerateRequestVo request);

    /**
     * kimi智能题目生成业务方法：检查kimi核心参数、生成提示词、调用kimi大模型、结果解析处理
     * @param request
     * @return
     */
    List<QuestionImportVo> generateQuestions(AiGenerateRequestVo request);


    /**
     * 构建判卷提示词
     * @param question
     * @param userAnswer
     * @param maxScore
     * @return
     */
    String buildGradingPrompt(Question question, String userAnswer, Integer maxScore);


    /**
     * 构建考试总评提示词
     */
    String buildSummaryPrompt(Integer totalScore, Integer maxScore, Integer questionCount, Integer correctCount);

    /**
     * 智能判卷单道题目
     */
    GradingResult gradeQuestion(Question question, String userAnswer, Integer maxScore);


    /**
     * ai生成考试评语和建议
     * @param totalScore
     * @param maxScore
     * @param questionCount
     * @param correctCount
     * @return
     */
    String generateExamSummary(Integer totalScore, Integer maxScore, Integer questionCount, Integer correctCount);

}